﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%request.setAttribute("ctx",request.getContextPath()); %>
<!-- Added by Doug on 04Sep: if value is BackBtn, don't do data cleanup -->
<% String initValue = (String) request.getAttribute("key"); %>
<%@ taglib prefix="rbac" uri="http://www.ebayAdmin.com/rbac"%>
<html>
<head>
<link href="${ctx}/extend/css/style.css" rel="stylesheet" type="text/css"/>
<script src="${ctx}/extend/js/jquery/jquery.js" type="text/javascript"></script>
<script src="${ctx}/extend/js/dutil/DUtil.js" type="text/javascript"></script>
<script src="${ctx}/extend/css/css.js" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="${ctx}/css/style.css" rel="stylesheet" type="text/css"/>
<script src="${ctx}/js/common.js" type="text/javascript"></script>
<script src="${ctx}/js/check.js" type="text/javascript"></script>
<script src="${ctx}/js/utils.js" type="text/javascript"></script>
<script src="${ctx}/js/common/merdiseSort.js" type="text/javascript"></script>
<title>资产筛选</title>

</head>


<body class="maintable">
<form name="merchandiseForm" method="POST" id="srchCrtForm" action="saveRecord" enctype="multipart/form-data">
<div id="div_all_document" style="height:100%;overflow-y:auto;position:relative;word-wrap: break-word; word-break: break-all;">
<div class="dclass_container" >
	<div class="dclass_container_header" >    	
        <div class="dclass_container_title">筛选资产 &nbsp; <input onClick="if(this.checked==true) { checkAll('selFilter'); } else { clearAll('selFilter'); }" type="checkbox" value="" name="test" title="全选/取消"/></div>    
    </div>
    
    <div class="dclass_container_content">

	<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#9FD6FF">
	     <tr>
         	<td width="20%" class="formtitle">
         		<input type="checkbox" value="sequenceNum" name="selFilter" <s:if test="dispRe.sequenceNum == 1">checked="checked"</s:if> />序号:
         	</td>
            <td width="30%" class="formtd"> 
            	<input name="srchCrt.sequenceNum" id="sequenceNum" type="text" class="inputform" value="${srchPreFill.sequenceNum}">
            </td>
            <td width="20%" class="formtitle"></td>
            <td width="30%" class="formtd"></td>
          </tr>
         <tr>
         	<td width="20%" class="formtitle">
         		<input type="checkbox" value="assetsNum" name="selFilter" <s:if test="dispRe.assetsNum == 1">checked="checked"</s:if> />资产号:
         	</td>
            <td width="30%" class="formtd">
            	<input name="srchCrt.assetsNum" id="assetsNum" type="text" class="inputform" value="${srchPreFill.assetsNum}">
            </td>    
			<td width="20%" class="formtitle">
				<input type="checkbox" value="selfNum" name="selFilter" <s:if test="dispRe.selfNum == 1">checked="checked"</s:if> /> 自编号:
			</td>
            <td width="30%" class="formtd">
            	<input name="srchCrt.selfNum" id="selfNum" type="text" class="inputform" value="${srchPreFill.selfNum}">
            </td>
          </tr>
          <tr>           
			<td width="20%" class="formtitle"><input type="checkbox" value="busType" name="selFilter" <s:if test="dispRe.busType == 1">checked="checked"</s:if> /> 业务类型:</td>
            <td width="30%" class="formtd"><input name="srchCrt.busType" id="busType" type="text" class="inputform" value="${srchPreFill.busType}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="projNum" name="selFilter" <s:if test="dispRe.projNum == 1">checked="checked"</s:if> />项目/工程号:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.projNum" id="projNum" type="text" class="inputform" value="${srchPreFill.projNum}"></td>
          </tr>
          <tr>           
			<td width="20%" class="formtitle"><input type="checkbox" value="projName" name="selFilter" <s:if test="dispRe.projName == 1">checked="checked"</s:if> /> 项目/工程名称:</td>
            <td width="30%" class="formtd"><input name="srchCrt.projName" id="projName" type="text" class="inputform" value="${srchPreFill.projName}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="prodType" name="selFilter" <s:if test="dispRe.prodType == 1">checked="checked"</s:if> /> 资产类型:</td>
            <td class="formtd">
				<select name="srchCrt.prodType" >
					<option value="">请选择</option>
					<c:forEach var="cvar"  items="${prodType}">
						<option value="${cvar.key}">${cvar.value}</option>
					</c:forEach>
				</select>
			</td>
          </tr>
          <tr>           
			<td width="20%" class="formtitle"><input type="checkbox" value="prodClass" name="selFilter" <s:if test="dispRe.prodClass == 1">checked="checked"</s:if> /> 资产分类:</td>
			<td class="formtd">
				<select name="srchCrt.prodClass" >
					<option value="">请选择</option>
					<c:forEach var="cvar"  items="${prodClass}">
						<option value="${cvar.key}">${cvar.value}</option>
					</c:forEach>
				</select>
			</td>
			<td width="20%" class="formtitle"><input type="checkbox" value="equipClass" name="selFilter" <s:if test="dispRe.equipClass == 1">checked="checked"</s:if> /> 设备分类:</td>
            <%-- <td class="formtd">
				<select name="srchCrt.equipClass" >
					<option value="">请选择</option>
					<c:forEach var="cvar"  items="${equipClass}">
						<option value="${cvar.key}">${cvar.value}</option>
					</c:forEach>
				</select>
			</td> --%>
			<td width="30%" class="formtd"><input name="srchCrt.equipClass" id="equipClass" type="text" class="inputform" value="${srchPreFill.equipClass}"></td>
          </tr>
          <tr>           
			<td width="20%" class="formtitle"><input type="checkbox" value="equipType" name="selFilter" <s:if test="dispRe.equipType == 1">checked="checked"</s:if> /> 设备类型:</td>
            <td width="30%" class="formtd"><input name="srchCrt.equipType" id="equipType" type="text" class="inputform" value="${srchPreFill.equipType}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="equipName" name="selFilter" <s:if test="dispRe.equipName == 1">checked="checked"</s:if> /> 设备名称:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.equipName" id="equipName" type="text" class="inputform" value="${srchPreFill.equipName}"></td>
          </tr>
          <tr>            
			<td width="20%" class="formtitle"><input type="checkbox" value="equipNickName" name="selFilter" <s:if test="dispRe.equipNickName == 1">checked="checked"</s:if> /> 设备别名:</td>
            <td width="30%" class="formtd"><input name="srchCrt.equipNickName" id="equipNickName" type="text" class="inputform" value="${srchPreFill.equipNickName}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="fiberType" name="selFilter" <s:if test="dispRe.fiberType == 1">checked="checked"</s:if> /> 光缆类型:</td>
            <td class="formtd">
				<select name="srchCrt.fiberType">
					<option value="">请选择</option>
					<c:forEach var="cvar"  items="${fiberType}">
						<option value="${cvar.key}">${cvar.value}</option>
					</c:forEach>
				</select>
			</td>
          </tr>

          <tr>           
            <td width="20%" class="formtitle"><input type="checkbox" value="fiberNum" name="selFilter" <s:if test="dispRe.fiberNum == 1">checked="checked"</s:if> /> 光缆芯数:<span>&nbsp;&nbsp;(正整数)</span></td>
            <td width="30%" class="formtd"> <input name="srchCrt.fiberNum" id="fiberNum" type="text" class="inputform" value="${srchPreFill.fiberNum}" ></td>
			<td width="20%" class="formtitle"><input type="checkbox" value="fiberLength" name="selFilter" <s:if test="dispRe.fiberLength == 1">checked="checked"</s:if> /> 光缆长度:<span>&nbsp;&nbsp;(正数)</span></td>
            <td width="30%" class="formtd"><input name="srchCrt.fiberLength" id="fiberLength" type="text" class="inputform" value="${srchPreFill.fiberLength}"></td>
          </tr>
          <tr>           
            <td width="20%" class="formtitle"><input type="checkbox" value="factoryName" name="selFilter" <s:if test="dispRe.factoryName == 1">checked="checked"</s:if> /> 厂家名:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.factoryName" id="factoryName" type="text" class="inputform" value="${srchPreFill.factoryName}" ></td>
			<td width="20%" class="formtitle"><input type="checkbox" value="provider" name="selFilter" <s:if test="dispRe.provider == 1">checked="checked"</s:if> /> 供货商:</td>
            <td width="30%" class="formtd"><input name="srchCrt.provider" id="provider" type="text" class="inputform" value="${srchPreFill.provider}"></td>
          </tr>
          <tr>           
            <td width="20%" class="formtitle"><input type="checkbox" value="equipModel" name="selFilter" <s:if test="dispRe.equipModel == 1">checked="checked"</s:if> /> 设备型号:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.equipModel" id="equipModel" type="text" class="inputform" value="${srchPreFill.equipModel}" ></td>
			<td width="20%" class="formtitle"><input type="checkbox" value="sn" name="selFilter" <s:if test="dispRe.sn == 1">checked="checked"</s:if> /> S/N:</td>
            <td width="30%" class="formtd"><input name="srchCrt.sn" id="sn" type="text" class="inputform" value="${srchPreFill.sn}"></td>
          </tr>
          <tr>
          	<td width="20%" class="formtitle"><input type="checkbox" value="macAddr" name="selFilter" <s:if test="dispRe.macAddr == 1">checked="checked"</s:if> /> MAC:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.macAddr" id="macAddr" type="text" class="inputform" value="${srchPreFill.macAddr}" ></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="modelNum" name="selFilter" <s:if test="dispRe.modelNum == 1">checked="checked"</s:if> /> 模块号:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.modelNum" id="modelNum" type="text" class="inputform" value="${srchPreFill.modelNum}" ></td>
          </tr>
          <tr>
			<td width="20%" class="formtitle"><input type="checkbox" value="standard" name="selFilter" <s:if test="dispRe.standard == 1">checked="checked"</s:if> /> 规格:</td>
            <td width="30%" class="formtd"><input name="srchCrt.standard" id="standard" type="text" class="inputform" value="${srchPreFill.standard}"></td>
            <!-- Permission added by Doug on Oct17 -->
            <td width="20%" class="formtitle">
            	<rbac:hasPermission permStr="/admin/price">
            	<input type="checkbox" value="unitPrice" name="selFilter" <s:if test="dispRe.unitPrice == 1">checked="checked"</s:if> /> 单价:<span>&nbsp;&nbsp;(正数)</span>
            	</rbac:hasPermission>
            </td>
            <td width="30%" class="formtd">
            	<rbac:hasPermission permStr="/admin/price"> 
            	<input name="srchCrt.unitPrice" id="unitPrice" type="text" class="inputform" value="${srchPreFill.unitPrice}" >
            	</rbac:hasPermission>
            </td>            
          </tr>
          <tr>
			<td width="20%" class="formtitle"><input type="checkbox" value="inputDate" name="selFilter" <s:if test="dispRe.inputDate == 1">checked="checked"</s:if> /> 入库日期:<span>&nbsp;&nbsp;(yyyy[-MM-dd])</span></br><span>&nbsp;&nbsp;(支持年/月模糊查询)</span></td>
            <td width="30%" class="formtd"><input name="srchCrt.inputDate" id="inputDate" type="text" class="inputform" value="${srchPreFill.inputDate}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="manDate" name="selFilter" <s:if test="dispRe.manDate == 1">checked="checked"</s:if> /> 出库日期:<span>&nbsp;&nbsp;(yyyy[-MM-dd])</span></br><span>&nbsp;&nbsp;(支持年/月模糊查询)</span></td>
            <td width="30%" class="formtd"> <input name="srchCrt.manDate" id="manDate" type="text" class="inputform" value="${srchPreFill.manDate}" ></td>
          </tr>
          
          <tr>
			<td width="20%" class="formtitle">
				<input type="checkbox" value="wareHouseMan" name="selFilter" <s:if test="dispRe.wareHouseMan == 1">checked="checked"</s:if> /> 仓库管理人:
			</td>
            <td width="30%" class="formtd">
            <rbac:hasPermission permStr="/admin/create">
            	<input name="srchCrt.wareHouseMan" id="wareHouseMan" type="text" class="inputform" value="${srchPreFill.wareHouseMan}">
            </rbac:hasPermission>
            </td>
            <td width="20%" class="formtitle"><input type="checkbox" value="useDate" name="selFilter" <s:if test="dispRe.useDate == 1">checked="checked"</s:if> /> 使用日期:<span>&nbsp;&nbsp;(yyyy[-MM-dd])</span></br><span>&nbsp;&nbsp;(支持年/月模糊查询)</span></td>
            <td width="30%" class="formtd"> <input name="srchCrt.useDate" id="useDate" type="text" class="inputform" value="${srchPreFill.useDate}" ></td>
          </tr>
          <tr>
			<td width="20%" class="formtitle"><input type="checkbox" value="chargeMan" name="selFilter" <s:if test="dispRe.chargeMan == 1">checked="checked"</s:if> /> 负责人:</td>
            <td width="30%" class="formtd"><input name="srchCrt.chargeMan" id="chargeMan" type="text" class="inputform" value="${srchPreFill.chargeMan}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="assetsMgnt" name="selFilter" <s:if test="dispRe.assetsMgnt == 1">checked="checked"</s:if> /> 资产管理人:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.assetsMgnt" id="assetsMgnt" type="text" class="inputform" value="${srchPreFill.assetsMgnt}" ></td>
          </tr>
           <tr>
			<td width="20%" class="formtitle"><input type="checkbox" value="equipLocalProvice" name="selFilter" <s:if test="dispRe.equipLocalProvice == 1">checked="checked"</s:if> /> 设备所在省:</td>
            <td width="30%" class="formtd"><input name="srchCrt.equipLocalProvice" id="equipLocalProvice" type="text" class="inputform" value="${srchPreFill.equipLocalProvice}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="equipLocalCity" name="selFilter" <s:if test="dispRe.equipLocalCity == 1">checked="checked"</s:if> /> 设备所在市:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.equipLocalCity" id="equipLocalCity" type="text" class="inputform" value="${srchPreFill.equipLocalCity}" ></td>
          </tr>
          <tr>
			<td width="20%" class="formtitle"><input type="checkbox" value="equipLocalDistrict" name="selFilter" <s:if test="dispRe.equipLocalDistrict == 1">checked="checked"</s:if> /> 设备所在区:</td>
            <td width="30%" class="formtd"><input name="srchCrt.equipLocalDistrict" id="equipLocalDistrict" type="text" class="inputform" value="${srchPreFill.equipLocalDistrict}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="equipLocalTown" name="selFilter" <s:if test="dispRe.equipLocalTown == 1">checked="checked"</s:if> /> 设备所在村镇:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.equipLocalTown" id="equipLocalTown" type="text" class="inputform" value="${srchPreFill.equipLocalTown}" ></td>
          </tr>
          <tr>
			<td width="20%" class="formtitle"><input type="checkbox" value="fiberStart" name="selFilter" <s:if test="dispRe.fiberStart == 1">checked="checked"</s:if> /> 光缆起点:</td>
            <td width="30%" class="formtd"><input name="srchCrt.fiberStart" id="fiberStart" type="text" class="inputform" value="${srchPreFill.fiberStart}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="fiberEnd" name="selFilter" <s:if test="dispRe.fiberEnd == 1">checked="checked"</s:if> /> 光缆终点:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.fiberEnd" id="fiberEnd" type="text" class="inputform" value="${srchPreFill.fiberEnd}" ></td>
          </tr>
          <tr>           
            <td width="20%" class="formtitle"><input type="checkbox" value="fiberEndCode" name="selFilter" <s:if test="dispRe.fiberEndCode == 1">checked="checked"</s:if> /> 光缆终止码号:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.fiberEndCode" id="fiberEndCode" type="text" class="inputform" value="${srchPreFill.fiberEndCode}" ></td>
			<td width="20%" class="formtitle"><input type="checkbox" value="exactLocation" name="selFilter" <s:if test="dispRe.exactLocation == 1">checked="checked"</s:if> /> 具体位置:</td>
            <td width="30%" class="formtd"><input name="srchCrt.exactLocation" id="exactLocation" type="text" class="inputform" value="${srchPreFill.exactLocation}"></td>
          </tr>
          <tr>          	
			<td width="20%" class="formtitle"><input type="checkbox" value="fiberStartCode" name="selFilter" <s:if test="dispRe.fiberStartCode == 1">checked="checked"</s:if> /> 光缆起始码号:</td>
            <td width="30%" class="formtd"><input name="srchCrt.fiberStartCode" id="fiberStartCode" type="text" class="inputform" value="${srchPreFill.fiberStartCode}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="belongFrame" name="selFilter" <s:if test="dispRe.belongFrame == 1">checked="checked"</s:if> /> 所属机架:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.belongFrame" id="belongFrame" type="text" class="inputform" value="${srchPreFill.belongFrame}" ></td>
          </tr>
          <tr>
			<td width="20%" class="formtitle"><input type="checkbox" value="localFrame" name="selFilter" <s:if test="dispRe.localFrame == 1">checked="checked"</s:if> /> 所在机框:</td>
            <td width="30%" class="formtd"><input name="srchCrt.localFrame" id="localFrame" type="text" class="inputform" value="${srchPreFill.localFrame}"></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="localChannel" name="selFilter" <s:if test="dispRe.localChannel == 1">checked="checked"</s:if> /> 所在槽道:</td>
            <td width="30%" class="formtd"> <input name="srchCrt.localChannel" id="localChannel" type="text" class="inputform" value="${srchPreFill.localChannel}" ></td>
          </tr>
          <tr>
			<td width="20%" class="formtitle"><input type="checkbox" value="currStatus" name="selFilter" <s:if test="dispRe.currStatus == 1">checked="checked"</s:if> /> 当前状态:</td>
            <td class="formtd">
				<select name="srchCrt.currStatus" >
					<option value="">请选择</option>
					<c:forEach var="cvar"  items="${currStatus}">
						<option id="currStatus" value="${cvar.key}">${cvar.value}</option>
					</c:forEach>
				</select>
			</td>   
            <%-- <td width="20%" class="formtitle"><input type="checkbox" value="ip" name="selFilter" <s:if test="dispRe.ip == 1">checked="checked"</s:if> /> IP 地址:<span>&nbsp;&nbsp;(255.255.255.255)</span></td>
            <td width="30%" class="formtd"> <input name="srchCrt.ip" id="ip" type="text" class="inputform" value="${srchPreFill.ip}" ></td> --%>
            <td width="20%" class="formtitle"><input type="checkbox" value="equipFunction" name="selFilter" <s:if test="dispRe.equipFunction == 1">checked="checked"</s:if> /> 设备功能:</td>
            <td width="30%" class="formtd"><input name="srchCrt.equipFunction" id="equipFunction" type="text" class="inputform" value="${srchPreFill.equipFunction}"></td>
          </tr>
         
          <tr>			
            <td width="20%" class="formtitle"><input type="checkbox" value="modifyDate" name="selFilter" <s:if test="dispRe.modifyDate == 1">checked="checked"</s:if> /> 修改日期:<span>&nbsp;&nbsp;(yyyy[-MM-dd])</span></br><span>&nbsp;&nbsp;(支持年/月模糊查询)</span></td>
            <td width="30%" class="formtd"> <input name="srchCrt.modifyDate" id="modifyDate" type="text" class="inputform" value="${srchPreFill.modifyDate}" ></td>
            <td width="20%" class="formtitle"><input type="checkbox" value="modifyResult" name="selFilter" <s:if test="dispRe.modifyResult == 1">checked="checked"</s:if> /> 修改原因:</td>
            <td width="30%" class="formtd"><input name="srchCrt.modifyResult" id="modifyResult" type="text" class="inputform" value="${srchPreFill.modifyResult}"></td>
          </tr>
         
          <tr>			
          	<td width="20%" class="formtitle"><input type="checkbox" value="compName" name="selFilter" <s:if test="dispRe.compName == 1">checked="checked"</s:if> />公司名称:</td>
            <td width="30%" colspan="3" class="formtd"><input name="srchCrt.compName" id="compName" type="text" class="inputform" value="${srchPreFill.compName}"></td>
          </tr>
          <tr>       
            <td width="20%" class="formtitle"><input type="checkbox" value="remarks" name="selFilter" <s:if test="dispRe.remarks == 1">checked="checked"</s:if> /> 备注:</td>
           	<td width="30%" colspan="3" class="formtd">
            	<textarea class="inputformtext100" name="srchCrt.remarks" id="remarks" >${srchPreFill.remarks}</textarea>
           </td>
          </tr> 
     </table>
     <br style="line-height:5px;"/>
	<br style="line-height:5px;"/>
    <div style="padding:0.3em; text-align:center">
    	<input type="button" class="button" value="搜索" onclick="javascript:searchReMd();" />
    	<!-- Added by Doug on Sep04 for better navigation support -->
		<!-- <input type="button" class="button" value="关 闭" onclick="javascript:history.back();" /> -->
		<input type="button" class="button" value="清空" onclick="javascript:clearInputContents();" />
    </div>
	</div>
	</div>
</div>
</form>
<script type="text/javascript">
/* Doug: temporarily disable this */
<%-- window.onload=defaultLoadFunction();
	
	function defaultLoadFunction(){
		/* genAssetsNum();
		setInputDate(); */
		alert("initValue is <%=initValue%>");
		if (initValue != 'backBtn')
		{
			clearInputContents();
		}
		clearInputContents();
		var el = document.getElementsByTagName('input');
	   	var len = el.length;
	   	for(var i=0; i<len; i++)
	   	{
	   		if((el[i].type=="checkbox") && (dispRe[el[i].value])==1)
	   		{
	   			el[i].checked = true;
	   		}
	   	}
	} --%>
	
    function searchReMd(){
    	//The checking on number of checked checkbox (added by Doug) is needed to give better look&feel
    	if (numOfChecked()>=8){
    		if(checkMd()){
    			var srchCrtForm=document.getElementById("srchCrtForm");
    			srchCrtForm.action="${ctx}/admin/listRe";
    			srchCrtForm.submit();
    			}
    	}
   		else{
   			alert("请勾选至少8个选项");
   		}
    }
    
	function checkMd(){
		var fiberNum = document.getElementById("fiberNum");
		var fiberLength = document.getElementById("fiberLength");
		var unitPrice = document.getElementById("unitPrice");
		/* var ip = document.getElementById("ip"); */
		var manDate = document.getElementById("manDate");
		var useDate = document.getElementById("useDate");
		var modifyDate = document.getElementById("modifyDate");
		var inputDate = document.getElementById("inputDate");
		//Added by Doug
		//var macAddr = document.getElementById("macAddr");
		
		/* if(!checkNull(fiberNum)) { */
		if(null != fiberNum) {
			if(! checkPositiveNum(fiberNum)){
				alert("光缆芯数必须是正整数!");
				document.getElementById("fiberNum").focus();
				return false;
			}
			
		}
		
		/* if(!checkNull(fiberLength)) { */
		if(null != fiberLength) {
			if(! checkPositiveNum(fiberLength)){
			alert("光缆长度必须是正数!!");
			document.getElementById("fiberLength").focus();
			return false;
			}
		
		}
		
		/* if(!checkNull(unitPrice)) { */
		if(null != unitPrice) {
			if(! checkPrice(unitPrice)){
			alert("单价必须是正数!");
			document.getElementById("unitPrice").focus();
			return false;
			}
		}
			
		
		/* if(!checkNull(ip)) {
			if(!checkIp(ip)) {
				alert("IP格式不正确!");
				document.getElementById("ip").focus();
				return false;
			}
		} */
		
		if(null != inputDate) {	
			if(!checkFuzzyDate(inputDate)) {
				alert("日期不正确!");
				document.getElementById("inputDate").focus();
				return false;
			}
		}
		
		if(null != manDate) {	
			if(!checkFuzzyDate(manDate)) {
				alert("日期不正确!");
				document.getElementById("manDate").focus();
				return false;
			}
		}
		
		if(null != modifyDate) {	
			if(!checkFuzzyDate(modifyDate)) {
				alert("日期不正确!");
				document.getElementById("modifyDate").focus();
				return false;
			}
		}
		
		if(null != useDate) {
			if(!checkFuzzyDate(useDate)) {
				alert("日期不正确!");
				document.getElementById("useDate").focus();
				return false;
			}
		}
		
		//Added by Doug
		/* if(null != macAddr) {
			if(!checkMac(macAddr)) {
				alert("mac地址格式不正确！mac地址格式为00:12:34:56:78:9A");
				document.getElementById("macAddr").focus();
				return false;
			}
		} */
		
		return true;
	}
	
	function checkAll(name){
	   	var el = document.getElementsByTagName('input');
	   	var len = el.length;
	   	for(var i=0; i<len; i++)
	   	{
	   		if((el[i].type=="checkbox") && (el[i].name==name))
	   		{
	   			el[i].checked = true;
	   		}
	   	}
	   }
	
	function clearAll(name){
	   	var el = document.getElementsByTagName('input');
	   	var len = el.length;
	   	for(var i=0; i<len; i++)
	   	{
	   		if((el[i].type=="checkbox") && (el[i].name==name))
	   		{
	   			el[i].checked = false;
	   		}
	   	}
	   }
	
	  //Added by Doug on Sep04 to count the number of checked checkbox
	  function numOfChecked(){
		  var i=0;
		  $("input[type='checkbox']:checked").each( 
				    function() {
				    	i++;
				    } 
				);
		  return i;
	  }
	  
	//Added by Doug on Sep04 to clear all contents inside input boxes
	  function clearInputContents(){
		  $(this.form).find(':input').each(function() {
			  if (this.type == 'text' || this.type == 'select-one' || this.type == 'textarea'){
				  $(this).val('');  
			  }
			  //Added by Doug on Sep24. Now we need to add following so that check status can be cleared
			  if(this.type=="checkbox"){
				  this.checked = false;
		   		}
			  }
		  );
	  }
</script>
</body>
</html>